<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->linkButton($this->__('system.button.disable'), "submitGridChecked('grid', '".$this->buildUrl('*/*/*/delete')."')"));
echo $t->renderItem($this->link($this->__('system.button.new'), $this->buildUrl('*/*/*/create')));
echo $t->renderEnd();

$this->nextBlock('grid');
$g = $this->grid('grid', $this->list->toArray())             
			->setSortField($GLOBALS[RC]->getRequest()->getParameter('sort', 'user_name'))
            ->setSortDirection($GLOBALS[RC]->getRequest()->getParameter('dir', 'asc'));
echo $g->renderBegin();
echo $g->renderHeadBegin();
echo $g->emptyHead()->setStyle('width', '30px');
echo $g->htmlHead($this->checkbox()->addClass('row-all-check')->toHtml())->setStyle('width', '30px');
echo $g->labelHead($this->__('system.label.username'))->setSortField('user_name')->toHtml();
echo $g->labelHead($this->__('system.label.email'))->setSortField('user_name')->toHtml();
echo $g->labelHead($this->__('account.last_ip'))->setStyle('width', '80px;')->toHtml();
echo $g->labelHead($this->__('account.last_active_time'))->setStyle('width', '150px')->toHtml();
echo $g->labelHead($this->__('system.label.status'))->setStyle('width', '80px')->setSortField('status')->toHtml();
echo $g->emptyHead();
echo $g->emptyHead();
echo $g->renderHeadEnd();
while($g->nextRow()):
	$currentRow = $g->getCurrentRow();
	echo $g->renderRowBegin();
	echo $g->indexCell()->toHtml();
	echo $g->checkboxCell('{version_id}', 'ids[]')->addClass('row-check')->toHtml();
	echo $g->labelCell('{user_name}')->toHtml();
    echo $g->labelCell('{email}')->toHtml();
	echo $g->labelCell('{ip_address}')->toHtml();
	echo $g->labelCell('{active_time}')->toHtml();	
    echo $g->statusLabelCell('{status}')->toHtml();
	if($currentRow['status'] != CONSTANT_STATUS_DELETED):
		echo $g->linkCell($this->__('system.button.modify'), $this->buildUrl('*/*/*/edit', array('id'=>'{id}')))
				->setStyle('width', 40)
				->setStyle('text-align', 'center')
				->toHtml();
		echo $g->linkCell($this->__('account.random_password'), $this->buildUrl('*/*/password/random', array('id'=>'{id}')))
				->setStyle('width', 60)
				->setStyle('text-align', 'center')
				->toHtml();				
	else:
		echo $g->emptyCell();
		echo $g->emptyCell();
	endif;
	echo $g->renderRowEnd();
endwhile;
echo $g->renderEnd();

$this->nextBlock('pagination');
echo $this->pagination($this->recordCount)->toHtml();
$this->endBlock();

echo $this->extend('template'.DS.'list');